<include file="Index:header" />
<!--头部 end -->
<!--左栏 starts -->
<div class="container-fluid">
		<div class="row-fluid">
			<include file="left" />

			<div id="content" class="span10">
			<!-- content starts -->
<!--左栏 end -->
<ul class="breadcrumb">
      <li>
        <a href="__APP__/Admin.html">首页</a> <span class="divider">/</span>
      </li>
      <li>
        <a href="__APP__/Admin/Loan/record.html">订单管理</a> <span class="divider">/</span>
      </li>
      <li class="active">发货</li>
    <div  class="pull-right"> <a class="ajax-link" href="__APP__/Admin/Loan/record.html" >返回订单管理</a></div>
</ul>
<table class="table table-striped table-bordered table-condensed ">
<thead>
  <tr>
    <th>订单号</th>
    <th>订单详情</th>
    <th  style="width:200px;">备注</th>
    <th style="width:200px;">订单价格/总数</th>
  </tr>
</thead>
<tbody>  
    <tr>
    <td>{$list.indent}</td>
    <td class="records_item">
    <assign name="ud" value="0" />
        <foreach name="list['goods']['goods_list']" item="v">
            <div class="it">
            <img class="img-rounded" src="__PUBLIC__/uploadify/uploads/commodity/{$v.img}_90_90.jpg"/>
            <ul>
                <li><a href="__APP__/Loan/invest/{$v.item_id}.html">{$v.item_title}</a></li>
                <li>单价：{$v.price}</li>
                <li>数量：{$v.number}</li>
                <li>尺寸：{$v.size_n}</li>
                <li>颜色：{$v.color_n}</li>
                <li>总价：{$v.total}</li>
            </ul>
            <if condition="($list['evaluation'][$ud] eq ' ') or ($list['evaluation'][$ud] eq '' )">
            <else/>
            <div style="float:left;clear: both;">
            <p>评分：{$list['score'][$ud]}分</p>
    		<p>评价：{$list['evaluation'][$ud]}</p>
            <if condition="($list['reply'][$ud] eq ' ') or ($list['reply'][$ud] eq '' )">
            <div id="r{$ud}">
            <p><textarea id="reply_{$ud}" class="autogrow" style="height:100px" placeholder="回复内容..."></textarea></p>
            <p><a class="btn btn-warning" onclick="Evaluation({$ud},{$Think.get.id})">确认提交</a></p>
            </div>
            <else/>
            <p>回复：{$list['reply'][$ud]}</p>
            </if >
            </div>
            </if>
            </div>
            <input type="hidden" value="{$ud++}" />
        </foreach>
    </td>
    <td>{$list.goods.note}</td>
    <td>{$list.goods.total_price}元<br/>{$list.goods.total_num}件</td>
  </tr>
</tbody>
</table>
<form method="post"  action='__URL__/deliveryUpda'>
<input name="id" type="hidden" value="{$list.id}" />
 <table class="table table-striped table-bordered table-condensed">
<tbody>
<tr><td>用户名：</td><td>{$list.username}</td></tr>
<tr><td>QQ：</td><td>{$list.qq}</td></tr>
<tr><td>固定电话：</td><td>{$list.fixed_line}</td></tr>
<tr><td>手机号：</td><td>{$list.cellphone}</td></tr>
<tr><td>收货人：</td><td>{$list.name}</td></tr>
<tr><td>收货详细地址：</td><td>{$list.location}&nbsp;&nbsp;{$list.company}</td></tr>
<tr><td>下单时间：</td><td>{$list.time|date="Y-m-d H:i:s",###} </td></tr>
<if condition="$list.audittime gt 0">
<tr><td>发货时间：</td><td>{$list.audittime|date="Y-m-d H:i:s",###} </td></tr>
</if>
<if condition="$list.endtime gt 0">
<tr><td>完成时间：</td><td>{$list.endtime|date="Y-m-d H:i:s",###} </td></tr>
</if>
<tr><td>状态：</td><td>
<if condition="$list.type eq 0">
待发货
<elseif condition="$list.type eq 1"/>
待收货
<elseif condition="$list.type eq 2"/>
完成
<elseif condition="$list.type eq 3"/>
失败
</if>
</td>
</tr>
<if condition="$list.type eq 3">
<tr><td>撤销原因：</td><td><textarea class="cleditor" rows="3">{$list.explain}</textarea></td></tr></if>
<tr><td>物流公司：</td><td>
<select name="company" class="span3">  
<option value='0' >请选择物流公司</option> 
<volist name="unit" id="vo">
<if condition="$vo.value eq $list.companys ">
<option value='{$vo.value}' selected>{$vo.name}</option>
<else />
<option value='{$vo.value}' >{$vo.name}</option>
</if>
</volist>
</select>
</td>
</tr>
<tr><td>快递单号：</td><td><input name="courier" type="text" class="span4" placeholder="请输入快递单号..." value="{$list.courier}"></td></tr>
<if condition="$list.audittime gt 0">
<tr><td>物流信息：</td><td>
<a href="#audit" data-toggle="modal" onclick="var name='{$list.companys}';var number='{$list.courier}'; $('#modal').load('__URL__/deliveryAjax',{name:name,number:number});">显示快递跟踪</a>
</td></tr>
</if>

</tbody>

 </table>
<div>
<div class="span4">

</div>
<if condition="$list.audittime eq 0">
<div class="span5">
<input name="type" type="hidden" value="1" />
<input name="number" type="hidden" value="{$list.indent}" />
<input name="uid" type="hidden" value="{$list.uid}" />
          <button class="btn btn-primary" type="submit">
              发货
          </button>
</div>
</if>
</div>
</form>
<!--底部 -->
<!--快递跟踪 start-->
<div id="audit" class="modal hide fade in" style="left:40%;width:800px;">
    <div class="modal-header">
      <a class="close" data-dismiss="modal" >&times;</a>
      <h3>快递跟踪</h3>
    </div>
    <div class="modal-body" >
    <table class="table table-striped table-bordered table-condensed">
        <tbody id="modal">
        	<tr>
            	<th>
            	<div class="invest_loading"><img src="__PUBLIC__/bootstrap/img/ajax-loaders/ajax-loader-1.gif"/></div>
                <div class="invest_loading">加载中...</div>
             	</th>
            </tr>
        </tbody>
    </table>
    </div>
</div>
<!--快递跟踪 end-->
<script>
/*
 * 回复AJAX
 * id 		键值
 * fid      订单ID
 **/
function Evaluation(id,fid){
	var evalu=$('#reply_'+id).val();
	$("#r"+id).load("__URL__/evaluationAjax", {id:id,evalu: evalu,fid:fid});
}
</script>
<include file="Index:footer" />